<!DOCTYPE html>
<html lang="en">
<#include "common/head.html">
<body class="fix-header fix-sidebar">
<!-- Preloader - style you can find in spinners.css -->
<div class="preloader">
    <svg class="circular" viewBox="25 25 50 50">
        <circle class="path" cx="50" cy="50" r="20" fill="none"
                stroke-width="2" stroke-miterlimit="10"/>
    </svg>
</div>
<!-- Main wrapper  -->
<div id="main-wrapper">
    <!-- header header  -->
    <#include "common/header.html">
    <!-- End header header -->
    <!-- Left Sidebar  -->
    <#include "common/nav.html">
    <!-- End Left Sidebar  -->
    <!-- Page wrapper  -->
    <div class="page-wrapper">
        <!-- 锐高软件 -->
        <#include "/common/ruigao.html" >

        <div class="container-fluid">
            <!-- Start Page Content -->
            <div class="row justify-content-center">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="card-content">
                                <!-- Left sidebar -->
                                <div class="inbox-leftbar">

                                    <a href="dotype"
                                       class="btn btn-danger btn-block waves-effect waves-light">
                                        <font style="vertical-align: inherit;"> <font
                                                style="vertical-align: inherit;">分类列表</font>
                                        </font>
                                    </a>
                                </div>
                                <!-- End Left sidebar -->
                                <div class="inbox-rightbar">
                                    <div class="" role="toolbar">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-light waves-effect">
                                                <i class="mdi mdi-archive font-18 vertical-middle"></i>
                                            </button>
                                            <button type="button" class="btn btn-light waves-effect">
                                                <i class="mdi mdi-alert-octagon font-18 vertical-middle"></i>
                                            </button>
                                            <button type="button" class="btn btn-light waves-effect">
                                                <i class="mdi mdi-delete-variant font-18 vertical-middle"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-validation">
                            <form id="form" class="form-valide col-lg-8" action="#" method="post"
                                  novalidate="novalidate" style="margin: 0 auto;">
                                <div class="form-group row">
                                    <label class="col-lg-2 col-form-label" for="val-title">类型识别字段</label>
                                    <div class="col-lg-10">
                                        <input type="text" class="form-control" id="val-title"
                                               name="typeIdentify" placeholder="${TypeTable.typeIdentify}"
                                               value="${TypeTable.typeIdentify}">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-lg-2 col-form-label" for="val-title">类型名称</label>
                                    <div class="col-lg-10">
                                        <input type="text" class="form-control" id="val-title"
                                               name="typeName" placeholder="${TypeTable.typeName}"
                                               value="${TypeTable.typeName}">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-lg-2 col-form-label" for="val-title">类型ID值</label>
                                    <div class="col-lg-10">
                                        <input type="text" class="form-control" id="val-title"
                                               name="typeTypeid" placeholder="${TypeTable.typeTypeid}"
                                               value="${TypeTable.typeTypeid}">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-lg-2 col-form-label" for="val-title">类型值名称</label>
                                    <div class="col-lg-10">
                                        <input type="text" class="form-control" id="val-title"
                                               name="typeTypevalue" placeholder="${TypeTable.typeTypevalue}"
                                               value="${TypeTable.typeTypevalue}">
                                    </div>
                                </div>
                                <input type="hidden" name="typeId" value="${TypeTable.typeId}">
                                <div class="form-group row">
                                    <div class="col-lg-8 ml-auto">
                                        <button type="submit"
                                                class="btn btn-success btn sweet-tijiao update">修改
                                        </button>
                                        <button type="reset" class="btn btn-primary ">重置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End PAge Content -->
    <!-- End Container fluid  -->
</div>
<!-- footer -->
<#include "common/footer.html">
<!-- End footer -->
<!-- End Page wrapper  -->
<#include "common/js.html">
<script type="text/javascript">
    $(".update").click(function () {

        $.ajax({
            url: "dataupdate",
            data: $("#form").serialize(),
            type: "GET",
            dataType: "json",
            success: function (data) {
                if (data) {
                    swal({
                            title: "更新成功!",
                            type: 'success',
                            text: "是否返回列表查看？",
                            showCancelButton: true,
                            closeOnConfirm: false,
                            cancelButtonText: "取消",
                            confirmButtonText: "确定"
                        },
                        function (inputValue) {
                            if (inputValue == true) {
                                location.href = "dotype";
                            } else {
                                return false;
                            }
                        });
                }
                else {
                    swal({
                        title: '更新失败！',
                        type: 'error',
                        confirmButtonText: '确定',
                        closeOnConfirm: false
                    });
                }
            },
            error: function (data) {
                swal({
                    title: '更新失败！',
                    type: 'error',
                    confirmButtonText: '确定',
                    closeOnConfirm: false
                });
            }
        });
        return false;
    })
</script>
</body>

</html>
